package com.chen.winnerframework.domain.dto.role;

import cn.hutool.core.bean.BeanUtil;
import com.chen.winnerframework.domain.entity.mybatis.rbac.Role;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 角色 数据传输对象
 *
 * @author chengy
 * @date 2022/11/25
 */
public class RoleDto {

    /**
     * 角色名称
     */
    @NotBlank(message = "角色名称不能为空")
    @ApiModelProperty(value = "角色名称", required = true)
    private String name;

    /**
     * 角色编码
     */
    @NotBlank(message = "角色编码不能为空")
    @ApiModelProperty(value = "角色编码", required = true)
    private String code;

    /**
     * 状态（1启用 0禁用）
     */
    @NotNull(message = "角色状态不能为空")
    @ApiModelProperty(value = "角色状态（1启用 0禁用）", required = true)
    private Integer status;

    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String remark;

    /**
     * 菜单ids
     */
    @ApiModelProperty("菜单id集合")
    private List<Integer> menuIds;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public List<Integer> getMenuIds() {
        return menuIds;
    }

    public void setMenuIds(List<Integer> menuIds) {
        this.menuIds = menuIds;
    }

    public Role toDo() {
        return BeanUtil.toBean(this, Role.class);
    }

}
